/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * FuncionesTrigonometricas.java
 *
 * Created on 02-sep-2011, 11:19:12
 */

package Fronteras;

import Controles.ControlFrame;
import javax.swing.JOptionPane;


/**
 *
 * @author AlejandroRincon-257179
 */
@SuppressWarnings("serial")
public class FuncionesTrigonometricas extends javax.swing.JPanel {

    /** Creates new form FuncionesTrigonometricas */
    public FuncionesTrigonometricas() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel2 = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();
        BSeno = new javax.swing.JButton();
        BCoseno = new javax.swing.JButton();
        BTangente = new javax.swing.JButton();
        jLabel3 = new javax.swing.JLabel();
        JTAngulo = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();

        jLabel2.setText("jLabel2");

        jLabel1.setText("FUNCIONES TRIGONOMETRICAS");

        BSeno.setText("Seno");
        BSeno.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BSenoActionPerformed(evt);
            }
        });

        BCoseno.setText("Coseno");
        BCoseno.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BCosenoActionPerformed(evt);
            }
        });

        BTangente.setText("Tangente");
        BTangente.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BTangenteActionPerformed(evt);
            }
        });

        jLabel3.setText("Ingrese Un Angulo Cualquiera");

        jLabel4.setText("En Radianes");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(57, 57, 57)
                        .addComponent(BSeno, javax.swing.GroupLayout.PREFERRED_SIZE, 83, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addContainerGap(29, Short.MAX_VALUE)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel4)
                            .addComponent(jLabel3))
                        .addGap(28, 28, 28)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(BCoseno, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(JTAngulo, javax.swing.GroupLayout.PREFERRED_SIZE, 111, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(38, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(137, Short.MAX_VALUE)
                .addComponent(BTangente, javax.swing.GroupLayout.PREFERRED_SIZE, 87, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(125, 125, 125))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(102, Short.MAX_VALUE)
                .addComponent(jLabel1)
                .addGap(88, 88, 88))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(19, 19, 19)
                .addComponent(jLabel1)
                .addGap(28, 28, 28)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(JTAngulo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel3))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel4)
                .addGap(50, 50, 50)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(BSeno)
                    .addComponent(BCoseno))
                .addGap(41, 41, 41)
                .addComponent(BTangente)
                .addContainerGap(62, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents

    private void BSenoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BSenoActionPerformed
      String a;
      a=JTAngulo.getText();
      double ang=Double.parseDouble(a);
      ControlFrame Operator= new ControlFrame() ;
      JOptionPane.showMessageDialog(null, "El Seno del Angulo es\n " + Operator.Seno(ang) );
    }//GEN-LAST:event_BSenoActionPerformed

    private void BCosenoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BCosenoActionPerformed
      String a;
      a=JTAngulo.getText();
      double ang=Double.parseDouble(a);
      ControlFrame Operator= new ControlFrame() ;
      JOptionPane.showMessageDialog(null, "El Coseno del Angulo es\n " + Operator.Coseno(ang) );
    }//GEN-LAST:event_BCosenoActionPerformed

    private void BTangenteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BTangenteActionPerformed
      String a;
      a=JTAngulo.getText();
      double ang=Double.parseDouble(a);
      ControlFrame Operator= new ControlFrame() ;
      JOptionPane.showMessageDialog(null, "La Tangente del Angulo es\n " + Operator.Tangente(ang) );
    }//GEN-LAST:event_BTangenteActionPerformed


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton BCoseno;
    private javax.swing.JButton BSeno;
    private javax.swing.JButton BTangente;
    private javax.swing.JTextField JTAngulo;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    // End of variables declaration//GEN-END:variables

}
